﻿using Game.FlowField.Components;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Transforms;

namespace Game.FlowField.Aspect
{
    public readonly partial struct UnitAspect : IAspect
    {
        public readonly Entity Self;
        public readonly RefRW<UnitComponentData> UnitComponentData;
        public readonly RefRW<LocalToWorldTransform> LocalToWorldTransform;

        public float3 Position
        {
            get => LocalToWorldTransform.ValueRW.Value.Position;

            set
            {
                LocalToWorldTransform.ValueRW.Value.Position = value;
            }
        }
    }
}
